/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import algorithm.GlouGlouAlgo;
import algorithm.ProblemData;
import algorithm.Reorganizer;
import algorithm.Solution;
import algorithm.Task;
import algorithm.WorkingTask;
import java.io.File;
import java.util.ArrayList;

/**
 *
 * @author Lu
 */
public class ReorganizerTest {

    public static void main(String[] argv){
//
//        File file = new File(".\\data\\TEST.TXT");
//        ProblemData pb = new ProblemData(file);
//        GlouGlouAlgo algo = new GlouGlouAlgo(pb);
//        algo.run();

        Solution randomSolution = new Solution(2);
//        randomSolution.setSolution(algo.getSolution());

        ArrayList<ArrayList<WorkingTask>> sol = new ArrayList<>();

        sol.add(new ArrayList<WorkingTask>());
        sol.add(new ArrayList<WorkingTask>());

        sol.get(0).add(new WorkingTask(0, 1, 2, 0, 0, null));
        sol.get(0).add(new WorkingTask(9, 12, 0, 0, 0, null));
        sol.get(0).add(new WorkingTask(4, 9, 1, 0, 0, null));
        sol.get(0).add(new WorkingTask(9, 12, 0, 0, 0, null));
        sol.get(0).add(new WorkingTask(12, 13, 0, 2, 0, null));
        sol.get(0).add(new WorkingTask(13, 14, 1, 2, 0, null));
        sol.get(1).add(new WorkingTask(0, 7, 0, 1, 1, null));
        sol.get(1).add(new WorkingTask(7, 11, 2, 1, 1, null));
        sol.get(1).add(new WorkingTask(15, 17, 1, 1, 1, null));

        randomSolution.setSolution(sol);
//
//        WorkingTask a = randomSolution.getSolution().get(1).get(1);
//        WorkingTask b = randomSolution.getSolution().get(0).get(4);
//        a.setRessource(0);
//        b.setRessource(1);
//        randomSolution.getSolution().get(1).set(1,b);
//        randomSolution.getSolution().get(0).set(4,a);


        System.out.println(randomSolution);

        Reorganizer r = new Reorganizer(2);
        Solution correctSolution = r.computeNewSolution(randomSolution);

        System.out.println(correctSolution);
    }

}
